<?php namespace app\Http\C5;

use p5\objects\TimeUtils;

/**
 * Created by PhpStorm.
 * User: simon
 * Date: 2016/3/8
 * Time: 11:18
 */
class C5Response
{
    public $success = true;
    public $code = "ok";
    public $timestamp = 0;
    public $message = "";
    public $result = "";

    public function __construct()
    {
        $this->timestamp = time() * 1000;
    }

    /**
     * @return mixed
     */
    public function getSuccess()
    {
        return $this->success;
    }

    /**
     * @param mixed $success
     */
    public function setSuccess($success)
    {
        $this->success = $success;
    }

    /**
     * @return mixed
     */
    public function getCode()
    {
        return $this->code;
    }

    /**
     * @param mixed $code
     */
    public function setCode($code)
    {
        $this->code = $code;
    }

    /**
     * @return mixed
     */
    public function getTimestamp()
    {
        return $this->timestamp;
    }

    /**
     * @param mixed $timestamp
     */
    public function setTimestamp($timestamp)
    {
        $this->timestamp = $timestamp;
    }

    /**
     * @return mixed
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * @param mixed $message
     */
    public function setMessage($message)
    {
        $this->message = $message;
    }

    /**
     * @return null
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * @param null $result
     */
    public function setResult($result)
    {
        $this->result = $result;
    }

    public function __toString()
    {
        return json_encode($this);
    }
}